import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/application/major_hazard/hazard_assessment_entity.dart';

HazardAssessmentEntity $HazardAssessmentEntityFromJson(Map<String, dynamic> json) {
  final HazardAssessmentEntity hazardAssessmentEntity = HazardAssessmentEntity();
  final String? agencyName = jsonConvert.convert<String>(json['agencyName']);
  if (agencyName != null) {
    hazardAssessmentEntity.agencyName = agencyName;
  }
  final String? anencyDate = jsonConvert.convert<String>(json['anencyDate']);
  if (anencyDate != null) {
    hazardAssessmentEntity.anencyDate = anencyDate;
  }
  final String? companyCode = jsonConvert.convert<String>(json['companyCode']);
  if (companyCode != null) {
    hazardAssessmentEntity.companyCode = companyCode;
  }
  final String? createBy = jsonConvert.convert<String>(json['createBy']);
  if (createBy != null) {
    hazardAssessmentEntity.createBy = createBy;
  }
  final String? createById = jsonConvert.convert<String>(json['createById']);
  if (createById != null) {
    hazardAssessmentEntity.createById = createById;
  }
  final String? createDate = jsonConvert.convert<String>(json['createDate']);
  if (createDate != null) {
    hazardAssessmentEntity.createDate = createDate;
  }
  final String? deleted = jsonConvert.convert<String>(json['deleted']);
  if (deleted != null) {
    hazardAssessmentEntity.deleted = deleted;
  }
  final int? fileType = jsonConvert.convert<int>(json['fileType']);
  if (fileType != null) {
    hazardAssessmentEntity.fileType = fileType;
  }
  final String? handledBy = jsonConvert.convert<String>(json['handledBy']);
  if (handledBy != null) {
    hazardAssessmentEntity.handledBy = handledBy;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    hazardAssessmentEntity.id = id;
  }
  final String? mobile = jsonConvert.convert<String>(json['mobile']);
  if (mobile != null) {
    hazardAssessmentEntity.mobile = mobile;
  }
  final String? riskObjectId = jsonConvert.convert<String>(json['riskObjectId']);
  if (riskObjectId != null) {
    hazardAssessmentEntity.riskObjectId = riskObjectId;
  }
  final String? updateBy = jsonConvert.convert<String>(json['updateBy']);
  if (updateBy != null) {
    hazardAssessmentEntity.updateBy = updateBy;
  }
  final String? updateById = jsonConvert.convert<String>(json['updateById']);
  if (updateById != null) {
    hazardAssessmentEntity.updateById = updateById;
  }
  final String? updateDate = jsonConvert.convert<String>(json['updateDate']);
  if (updateDate != null) {
    hazardAssessmentEntity.updateDate = updateDate;
  }
  final String? url = jsonConvert.convert<String>(json['url']);
  if (url != null) {
    hazardAssessmentEntity.url = url;
  }
  return hazardAssessmentEntity;
}

Map<String, dynamic> $HazardAssessmentEntityToJson(HazardAssessmentEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['agencyName'] = entity.agencyName;
  data['anencyDate'] = entity.anencyDate;
  data['companyCode'] = entity.companyCode;
  data['createBy'] = entity.createBy;
  data['createById'] = entity.createById;
  data['createDate'] = entity.createDate;
  data['deleted'] = entity.deleted;
  data['fileType'] = entity.fileType;
  data['handledBy'] = entity.handledBy;
  data['id'] = entity.id;
  data['mobile'] = entity.mobile;
  data['riskObjectId'] = entity.riskObjectId;
  data['updateBy'] = entity.updateBy;
  data['updateById'] = entity.updateById;
  data['updateDate'] = entity.updateDate;
  data['url'] = entity.url;
  return data;
}

extension HazardAssessmentEntityExtension on HazardAssessmentEntity {
  HazardAssessmentEntity copyWith({
    String? agencyName,
    String? anencyDate,
    String? companyCode,
    String? createBy,
    String? createById,
    String? createDate,
    String? deleted,
    int? fileType,
    String? handledBy,
    String? id,
    String? mobile,
    String? riskObjectId,
    String? updateBy,
    String? updateById,
    String? updateDate,
    String? url,
  }) {
    return HazardAssessmentEntity()
      ..agencyName = agencyName ?? this.agencyName
      ..anencyDate = anencyDate ?? this.anencyDate
      ..companyCode = companyCode ?? this.companyCode
      ..createBy = createBy ?? this.createBy
      ..createById = createById ?? this.createById
      ..createDate = createDate ?? this.createDate
      ..deleted = deleted ?? this.deleted
      ..fileType = fileType ?? this.fileType
      ..handledBy = handledBy ?? this.handledBy
      ..id = id ?? this.id
      ..mobile = mobile ?? this.mobile
      ..riskObjectId = riskObjectId ?? this.riskObjectId
      ..updateBy = updateBy ?? this.updateBy
      ..updateById = updateById ?? this.updateById
      ..updateDate = updateDate ?? this.updateDate
      ..url = url ?? this.url;
  }
}
